'use strict';
const PlaneInfoManager = new function () {
	const that = {
		score: 0,
		mission: 1,
		speed: 1,
		speedTime:[1000,800,600,400,200,100,80,60,40,20],
		ctx: null,
		init: function (cxt) {
			that.ctx = cxt;
			that.redraw();
		},
		//重画
		redraw: function () {

			Canvas.clear(that.ctx, 200, 500);

			Canvas.drawText(that.ctx, "得分:" + this.score, 20, 30, "red");
			Canvas.drawText(that.ctx, "第" + this.mission + "关", 20, 60, "red");
			Canvas.drawText(that.ctx, "速度:" + this.speed, 20, 90, "red");

		},
		//更新金钱
		updateScore: function (score) {
			this.score += score;

			this.redraw();
		},
		//更新关数
		updateMission: function () {

			this.mission += 1;

			this.redraw();
		},
		//更新速度
		updateSpeed: function () {

			this.speed += 1;

			this.redraw();

		},
	};
	return that;
};